\section{RtApi Class Reference}
\label{class_rt_api}\index{RtApi@{RtApi}}
Inheritance diagram for RtApi:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{class_rt_api}
\end{center}
\end{figure}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct {\bf ConvertInfo}
\item 
struct {\bf RtApiStream}
\end{DoxyCompactItemize}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual {\bf RtAudio::Api} {\bfseries getCurrentApi} (void)=0\label{class_rt_api_aace5faa22a1615993d038c7acb37dbf4}

\item 
virtual unsigned int {\bfseries getDeviceCount} (void)=0\label{class_rt_api_a4efee04d90b46722e80fce09cd72dfb3}

\item 
virtual {\bf RtAudio::DeviceInfo} {\bfseries getDeviceInfo} (unsigned int device)=0\label{class_rt_api_a62787b01c30a6addb243cd7da794dfdc}

\item 
virtual unsigned int {\bfseries getDefaultInputDevice} (void)\label{class_rt_api_a6178ebc0e78bfdd277d7fedf7b88d44f}

\item 
virtual unsigned int {\bfseries getDefaultOutputDevice} (void)\label{class_rt_api_afbe763b59fb7a3d346eb0c95945950c7}

\item 
void {\bfseries openStream} ({\bf RtAudio::StreamParameters} $\ast$outputParameters, {\bf RtAudio::StreamParameters} $\ast$inputParameters, {\bf RtAudioFormat} format, unsigned int sampleRate, unsigned int $\ast$bufferFrames, {\bf RtAudioCallback} callback, void $\ast$userData, {\bf RtAudio::StreamOptions} $\ast$options)\label{class_rt_api_a84da99ae8e633b8f593fe628fd933889}

\item 
virtual void {\bfseries closeStream} (void)\label{class_rt_api_a13e0f615a63a540446bd8bb7e44c293f}

\item 
virtual void {\bfseries startStream} (void)=0\label{class_rt_api_a10ee2f45dc6c1200da231365b4686ac8}

\item 
virtual void {\bfseries stopStream} (void)=0\label{class_rt_api_af17a556cb2534b53da961d3a6acba11e}

\item 
virtual void {\bfseries abortStream} (void)=0\label{class_rt_api_af65fd257cc358db6da29fbcef90287c7}

\item 
long {\bfseries getStreamLatency} (void)\label{class_rt_api_afa13bea09f646779d8b9cbc829d7675f}

\item 
unsigned int {\bfseries getStreamSampleRate} (void)\label{class_rt_api_a349576b3f0982428bef389a82946009d}

\item 
virtual double {\bfseries getStreamTime} (void)\label{class_rt_api_a5b3e624c2833c692674069cd0d13d2dc}

\item 
bool {\bfseries isStreamOpen} (void) const \label{class_rt_api_a239137ab1d22db7e35655d44162391d3}

\item 
bool {\bfseries isStreamRunning} (void) const \label{class_rt_api_a6ce7d955a1e7319137214db028cfbb07}

\item 
void {\bfseries showWarnings} (bool value)\label{class_rt_api_a3c28d90eda75287192b012eba92718ec}

\end{DoxyCompactItemize}
\subsection*{Protected Types}
\begin{DoxyCompactItemize}
\item 
enum \{ {\bfseries FAILURE}, 
{\bfseries SUCCESS}
 \}
\item 
enum {\bfseries StreamState} \{ {\bfseries STREAM\_\-STOPPED}, 
{\bfseries STREAM\_\-RUNNING}, 
{\bfseries STREAM\_\-CLOSED} =  -\/50
 \}
\item 
enum {\bfseries StreamMode} \{ {\bfseries OUTPUT}, 
{\bfseries INPUT}, 
{\bfseries DUPLEX}, 
{\bfseries UNINITIALIZED} =  -\/75
 \}
\item 
typedef signed short {\bfseries Int16}\label{class_rt_api_aa5a524a28ea28f031ca0a0a9e024ff39}

\item 
typedef signed int {\bfseries Int32}\label{class_rt_api_a438fed76129128575398354b306a4cc2}

\item 
typedef float {\bfseries Float32}\label{class_rt_api_aefb8b52708f6a43a62fcb31da11c0484}

\item 
typedef double {\bfseries Float64}\label{class_rt_api_ae10c5228f8184b69c1102f5d90992f23}

\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual bool {\bf probeDeviceOpen} (unsigned int device, StreamMode mode, unsigned int channels, unsigned int firstChannel, unsigned int sampleRate, {\bf RtAudioFormat} format, unsigned int $\ast$bufferSize, {\bf RtAudio::StreamOptions} $\ast$options)
\item 
void {\bf tickStreamTime} (void)\label{class_rt_api_ae20a4060301413ddcddc6bf149bbf911}

\begin{DoxyCompactList}\small\item\em A protected function used to increment the stream time. \item\end{DoxyCompactList}\item 
void {\bf clearStreamInfo} ()\label{class_rt_api_adb7ab7111510e3db1f0884a68926b5a4}

\begin{DoxyCompactList}\small\item\em Protected common method to clear an \doxyref{RtApiStream}{p.}{struct_rt_api_1_1_rt_api_stream} structure. \item\end{DoxyCompactList}\item 
void {\bf verifyStream} (void)
\item 
void {\bf error} ({\bf RtError::Type} type)\label{class_rt_api_a80d75cb44a194e2f07807f3ab80961a4}

\begin{DoxyCompactList}\small\item\em Protected common error method to allow global control over error handling. \item\end{DoxyCompactList}\item 
void {\bf convertBuffer} (char $\ast$outBuffer, char $\ast$inBuffer, {\bf ConvertInfo} \&info)
\item 
void {\bf byteSwapBuffer} (char $\ast$buffer, unsigned int samples, {\bf RtAudioFormat} format)\label{class_rt_api_a0d1b716b762e865a5b460be2117bb5ed}

\begin{DoxyCompactList}\small\item\em Protected common method used to perform byte-\/swapping on buffers. \item\end{DoxyCompactList}\item 
unsigned int {\bf formatBytes} ({\bf RtAudioFormat} format)\label{class_rt_api_a61fd2ec8b7bb72580bcf0233fd150f5f}

\begin{DoxyCompactList}\small\item\em Protected common method that returns the number of bytes for a given format. \item\end{DoxyCompactList}\item 
void {\bf setConvertInfo} (StreamMode mode, unsigned int firstChannel)\label{class_rt_api_af06289f7963ccc23dcd64eab911b26cd}

\begin{DoxyCompactList}\small\item\em Protected common method that sets up the parameters for buffer conversion. \item\end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
std::ostringstream {\bfseries errorStream\_\-}\label{class_rt_api_a3498df7d2f954d691d52c75f29dd8873}

\item 
std::string {\bfseries errorText\_\-}\label{class_rt_api_ab512557e93839a7cbb997160b08d3c18}

\item 
bool {\bfseries showWarnings\_\-}\label{class_rt_api_aa9142cb3f4df970af4ee37fedb2f16b1}

\item 
{\bf RtApiStream} {\bfseries stream\_\-}\label{class_rt_api_a818637ca9005b0270d56eaaea4697b34}

\end{DoxyCompactItemize}
\subsection*{Static Protected Attributes}
\begin{DoxyCompactItemize}
\item 
static const unsigned int {\bfseries MAX\_\-SAMPLE\_\-RATES} = 14\label{class_rt_api_a59917a16adcd5eb468dd88d4c5b8c289}

\item 
static const unsigned int {\bfseries SAMPLE\_\-RATES} [$\,$]
\end{DoxyCompactItemize}


\subsection{Member Function Documentation}
\index{RtApi@{RtApi}!convertBuffer@{convertBuffer}}
\index{convertBuffer@{convertBuffer}!RtApi@{RtApi}}
\subsubsection[{convertBuffer}]{\setlength{\rightskip}{0pt plus 5cm}void RtApi::convertBuffer (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{outBuffer, }
\item[{char $\ast$}]{inBuffer, }
\item[{{\bf ConvertInfo} \&}]{info}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [protected]}}\label{class_rt_api_a85ed0a3827faddf0c796869e72800850}
Protected method used to perform format, channel number, and/or interleaving conversions between the user and device buffers. \index{RtApi@{RtApi}!probeDeviceOpen@{probeDeviceOpen}}
\index{probeDeviceOpen@{probeDeviceOpen}!RtApi@{RtApi}}
\subsubsection[{probeDeviceOpen}]{\setlength{\rightskip}{0pt plus 5cm}bool RtApi::probeDeviceOpen (
\begin{DoxyParamCaption}
\item[{unsigned int}]{device, }
\item[{StreamMode}]{mode, }
\item[{unsigned int}]{channels, }
\item[{unsigned int}]{firstChannel, }
\item[{unsigned int}]{sampleRate, }
\item[{{\bf RtAudioFormat}}]{format, }
\item[{unsigned int $\ast$}]{bufferSize, }
\item[{{\bf RtAudio::StreamOptions} $\ast$}]{options}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [protected, virtual]}}\label{class_rt_api_a7cb2af485df310d803e7a35d3e4a2c1b}
Protected, api-\/specific method that attempts to open a device with the given parameters. This function MUST be implemented by all subclasses. If an error is encountered during the probe, a \char`\"{}warning\char`\"{} message is reported and FAILURE is returned. A successful probe is indicated by a return value of SUCCESS. \index{RtApi@{RtApi}!verifyStream@{verifyStream}}
\index{verifyStream@{verifyStream}!RtApi@{RtApi}}
\subsubsection[{verifyStream}]{\setlength{\rightskip}{0pt plus 5cm}void RtApi::verifyStream (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  [protected]}}\label{class_rt_api_acb0a053f68f082bb0f7ed4d056be1ea6}
Protected common method that throws an \doxyref{RtError}{p.}{class_rt_error} (type = INVALID\_\-USE) if a stream is not open. 

\subsection{Member Data Documentation}
\index{RtApi@{RtApi}!SAMPLE\_\-RATES@{SAMPLE\_\-RATES}}
\index{SAMPLE\_\-RATES@{SAMPLE\_\-RATES}!RtApi@{RtApi}}
\subsubsection[{SAMPLE\_\-RATES}]{\setlength{\rightskip}{0pt plus 5cm}const unsigned int RtApi::SAMPLE\_\-RATES\hspace{0.3cm}{\ttfamily  [static, protected]}}\label{class_rt_api_a84f89655b9f487005d10929ff9453ad2}
{\bfseries Initial value:}
\begin{DoxyCode}
 {
  4000, 5512, 8000, 9600, 11025, 16000, 22050,
  32000, 44100, 48000, 88200, 96000, 176400, 192000
}
\end{DoxyCode}


The documentation for this class was generated from the following files:\begin{DoxyCompactItemize}
\item 
Include/{\bf RtAudio.h}\item 
Include/RtAudio.cpp\end{DoxyCompactItemize}
